package com.jichangxiu.flow.server.core.entity.Bo;

import com.jichangxiu.flow.server.core.entity.dto.Edge;
import com.jichangxiu.flow.server.core.entity.dto.Point;
import com.jichangxiu.flow.server.core.entity.dto.Text;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * EdgeBo:
 *
 * @author Jcx
 * @create 2025-01-01 00:00:00
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EdgeBo implements Serializable, Cloneable {

    private String id;

    private String type;

    private String sourceNodeId;

    private String targetNodeId;

    private Point startPoint;

    private Point endPoint;

    private List<Point> pointsList;

    private Map<String, Object> properties;

    private Text text;

    private String sourceAnchorId;

    private String targetAnchorId;

    public static EdgeBo initEdgeBo(Edge edge) {
        return new EdgeBo(edge.getId(), edge.getType(), edge.getSourceNodeId(), edge.getTargetNodeId(), edge.getStartPoint(), edge.getEndPoint(), edge.getPointsList(), edge.getProperties(), edge.getText(), edge.getSourceAnchorId(), edge.getTargetAnchorId());
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

}
